$(function () {

})
//注册
function getRegister() {
    var User = $('#user').val();
    var Pass = $('#password').val();
    var data = {
        USERNAME: User,
        USERPASS: Pass
    };
    if (User == '' || null) {
        alert('用户名不能为空！')
        return false;
    } else if (Pass == '' || null) {
        alert('密码不能为空!')
        return false;
    } else if (Pass.length < 4 || Pass.length > 10) {
        alert('密码长度为4~10位')
        return false;
    } else {
        $.ajax({
            url: 'http://123.206.94.95/chat/chat/chatuser',
            type: 'POST',
            data: JSON.stringify(data),
            dataType: 'json',
            contentType: 'application/json;charset=UTF-8',
            success: function (res) {
                console.log(res)
                if(res.code = 'success'){
                    console.log('登录成功!')
                }else{
                    console.log(res.msg)
                }
            }
        })
    }



}
//登录
function getLogin() {
    var User = $('#user').val();
    var Pass = $('#password').val();
    var data = {
        USERNAME: User,
        USERPASS: Pass
    };
    if (User == '' || null) {
        alert('用户名不能为空！')
        return false;
    } else if (Pass == '' || null) {
        alert('密码不能为空!')
        return false;
    } else {
        $.ajax({
            url: 'http://123.206.94.95/chat/chat/chatuser',
            type: 'POST',
            data: JSON.stringify(data),
            dataType: 'json',
            contentType: 'application/json;charset=UTF-8',
            success: function (res) {
                console.log(res)
            }
        })
    }
}